Implement a per interpreter language server cache - #8815
Conversation
Put cache inside of the activationService
Codecov Report
@@ Coverage Diff @@
## master #8815 +/- ##
==========================================
- Coverage 58.65% 57.59% -1.06%
==========================================
Files 526 527 +1
Lines 27204 27124 -80
Branches 4059 4123 +64
==========================================
- Hits 15956 15623 -333
- Misses 10369 10617 +248
- Partials 879 884 +5
Continue to review full report at Codecov.
|
|
Actually I had another thought on my way home last night. I want to change the disconnect/reconnect pattern to activate/deactivate. Otherwise when we have a notebook switch kernels, we might end up activating a language server for VS code and have two activated at the same time (right now activate is called when the language server is created). I'm going to change activate to basically be reconnect, and have a 'start' on each language server which prepares it to be connected to VS code. Activate will then actually allow that language server to be the VS code language server. #Resolved |
Don Jayamanne (DonJayamanne)
left a comment
There was a problem hiding this comment.
Still got a lot to review...
| import { noop } from '../common/utils/misc'; | ||
| import { ILanguageServer, LanguageServerActivator } from './types'; | ||
|
|
||
| export class RefCountedLanguageServer implements ILanguageServer { |
There was a problem hiding this comment.
You can use Proxy class instead. Avoids the need to implement each method. #WontFix
There was a problem hiding this comment.
Ah I thought there was some way to not have to implement each. Thanks will change.
In reply to: 351403997 [](ancestors = 351403997)
There was a problem hiding this comment.
Proxy class is messing up tests. Don and I talked and this seemed like the least exposed way to implement the ref counting idea.
In reply to: 351423686 [](ancestors = 351423686,351403997)
|
Don Jayamanne (@DonJayamanne) did you have any more changes? |
For #8206
Change how language servers are started and shutdown. Instead of there being only one at a time, allow many based on the interpreter in use.
The crux of this change is in the activationService.ts, It is now also a cache (it kinda had one already) that can be queried to return a language server.
Each language server
The reason for this change is because Notebooks can select a different python to use (called a kernel) than what is currently selected in the python selection.